#include "luat_base.h"
#include "luat_lcd.h"

#define LUAT_LOG_TAG "st7796"
#include "luat_log.h"

static const uint16_t st7796_init_cmds[] = {
    0x02f0,0x03c3,
	0x02f0,0x0396,
    /* RGB 5-6-5-bit  */
    0x023A,0x0355,
    0x02B4,0x0301,
    0x02B7,0x03C6,
    0x02e8,0x0340,0x038a,0x0300,0x0300,0x0329,0x0319,0x03a5,0x0333,
    0x02c1,0x0306,
    0x02c2,0x03a7,
    0x02c5,0x0318,
    0x02e0,0x03f0,0x0309,0x030b,0x0306,0x0304,0x0315,0x032f,0x0354,0x0342,0x033c,0x0317,0x0314,0x0318,0x031b,
    0x02e1,0x03f0,0x0309,0x030b,0x0306,0x0304,0x0303,0x032d,0x0343,0x0342,0x033b,0x0316,0x0314,0x0317,0x031b,
    0x02f0,0x033c,
    0x02f0,0x0369,
};


luat_lcd_opts_t lcd_opts_st7796 = {
    .name = "st7796",
    .init_cmds_len = sizeof(st7796_init_cmds)/sizeof(st7796_init_cmds[0]),
    .init_cmds = st7796_init_cmds,
    .direction0 = 0x48,
    .direction90 = 0x88,
    .direction180 = 0x28,
    .direction270 = 0xE8
};
